import time

from model.configuration import *

def log(text):
    config = configuration()
    header = time.strftime("%d/%m/%Y %H:%M:%S --> ")
    filePath = config.LogPath
    logLine = header+text
    if config.LogType == 'console':
        print logLine
    if config.LogType == 'file':
        f=open(filePath,'a')
        f.write(logLine+'\n')
        f.close()
    del(config)
